package com.beta.em.pay;

import org.apache.commons.lang3.StringUtils;

/**
 * 支付产品类型为ONEKEY、DIRECT时方有效
 * Created by vector on 2016/12/6.
 */
public enum  YeepayPayProduct {

    WAP_SM("WAP_SM", "PC扫码"),
    ONEKEY_NORMAL("ONEKEY_NORMAL", "PC一键"),
    NET_B2B("NET_B2B", "网银B2B"),
    NET_B2C("NET_B2C", "网银B2C"),
    WAP_ZHT("WAP-ZHT", "手机端一键支付"),
    PAY_4G("4G_PAY", "无卡直连支付"),
    PAY_4G_FIRST("4G_PAY_FIRST", "直连首次支付"),
    PAY_4G_BIND("4G_PAY_BIND", "直连绑卡支付"),
    MEMBER_NORMAL("MEMBER_NORMAL", "会员支付"),
    LEDGER_NORMAL("LEDGER_NORMAL", "账户支付"),
    AGREEMENT_NORMAL("AGREEMENT_NORMAL", "协议支付"),
    WECHATU("WECHATU", "用户扫码支付"),
    WECHATG("WECHATG", "公众号支付"),
    WECHAT_APP("WECHAT_APP", "App支付-WX"),
    ALIPAY_APP("ALIPAY_APP", "APP支付-ZFB"),
    WAP_WECHATAPP("WAP_WECHATAPP", "WAP钱包支付-WX"),
    WAP_ALIPAYAPP("WAP_ALIPAYAPP", "WAP 钱包支付-ZFB"),
    ;

    public final String value;
    public final String desc;

    YeepayPayProduct(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static YeepayPayProduct getPayProduct(String value) {
        for (YeepayPayProduct payProduct: values()) {
            if (StringUtils.equals(payProduct.value, value)) {
                return payProduct;
            }
        }
        return null;
    }

}
